programming4us
           
 
 
Applications Server

BizTalk Server 2009 : Using queues within asynchronous scenarios (part 1)

- Free product key for windows 10
- Free Product Key for Microsoft office 365
- Malwarebytes Premium 3.7.1 Serial Keys (LifeTime) 2019
12/26/2010 9:00:04 AM
Queue-based technology is an underrepresented but powerful way to exchange data and events between disconnected clients. WCF has full support for Microsoft's queuing implementation (MSMQ) and BizTalk has an adapter specifically targeted at the netMsmqBinding WCF binding.

Why introduce yet another layer in your service communication? BizTalk has queuing logic, so what benefit do we get by having our service client send a message to an external queue that BizTalk acts upon? First of all, you get delivery assurance in the case of the service being offline. As you are not travelling over an inherently unreliable transport like HTTP, you can be confident that your message will arrive only once at its destination because of the intermediary queue. Also, a queue enables you to implement a level of soft throttling by allowing the queue to get pummeled by inbound requests but allow the service to process them at its leisure.

What we will demonstrate here is how to put MSMQ on both ends of a BizTalk solution. That is, the client application calls a BizTalk WCF endpoint that uses MSMQ as its transport, and when processing is complete, BizTalk sends its concluding message to a service over a MSMQ channel.

As with all other WCF bindings, the developer's interactions with MSMQ are fairly transparent and do not actively impact the client code. A developer does not need to understand any of the plumbing behind MSMQ and only need to flip the appropriate binding switches to use the queuing transport.

Before building any BizTalk bits, how about we create the actual queues that our solution will use. To access the MSMQ panel in Windows Server 2008, we visit the Server Manager, expand the Features node, and highlight the Messaging Queuing node. Here we can create two private transactional queues that will house our information while in transit between client and service.

Now we erect the terminating service, which publishes a final acknowledgement message to a dedicated queue. For our scenario, we have a customer satisfaction system that is interested in knowing when adverse events have been resolved. This system wants to send surveys to those who have interacted with our company and gauge their opinions of our efficiency. The first step to building our service requires building our interface contract. We will keep it fairly simple.

[ServiceContract(Namespace = "http://Seroter.BizTalkSOA.Chapter6")]
public interface ISatisfactionSystem
{

[OperationContract(IsOneWay = true)]

void ProcessClosedAE(ClosedAE closedAE);
}
[DataContract(Namespace = "http://Seroter.BizTalkSOA.Chapter6")]
public class ClosedAE
{
[DataMember]
public string AEID { get; set; }
[DataMember]
public string Product { get; set; }
[DataMember]
public string ResolutionDescription { get; set; }
[DataMember]
public DateTime CloseDate { get; set; }
}

I've highlighted the fact that service operations used on MSMQ service endpoints must be designated with a one-way messaging pattern. This is the rare example of endpoint selection playing a primary role in contract design.

Critical point:

Earlier I mentioned that BizTalk Server 2009 does not support truly asynchronous services that have their IsOneWay flag set to true. That's not entirely true. WCF service contracts associated with the MSMQ transport require that the IsOneWay flag is equal to true, and BizTalk readily supports that. Hence, unlike other WCF bindings, the MSMQ binding requires you to be aware of which transport you are planning to use when designing the contract.


Next, our contract needs to be implemented by an actual service. In this case, our service will simply write a notification in the machine's event log when a message has been received from the queue.

class SatisfactionSystemService : ISatisfactionSystem
{
public void ProcessClosedAE(ClosedAE closedAE)
{
System.Diagnostics.EventLog.WriteEntry("Satisfaction System Service", "Adverse Event Closed Event Received for case " + closedAE.AEID);
}
}


Finally, we have to host our service. In this case, we can once again exploit our existing WCF Service project and add a new individual service (.svc file) to it. After this is in place with the appropriate service directive, we simply need to append a new service endpoint in our configuration file.


Other -----------------
- Exchange Server 2010 : Upgrading from and Coexisting with Exchange Server 2003 (part 13) - Removing Legacy Exchange Servers
- Exchange Server 2010 : Upgrading from and Coexisting with Exchange Server 2003 (part 12) - Planning Public Folder Access and Migration
- Exchange Server 2010 : Upgrading from and Coexisting with Exchange Server 2003 (part 11)
- Exchange Server 2010 : Upgrading from and Coexisting with Exchange Server 2003 (part 10) - Recipient Update Service Migration
- Exchange Server 2010 : Upgrading from and Coexisting with Exchange Server 2003 (part 9) - Moving Offline Address Books
- Exchange Server 2010 : Upgrading from and Coexisting with Exchange Server 2003 (part 8)
- Exchange Server 2010 : Upgrading from and Coexisting with Exchange Server 2003 (part 7) - Coexistence for Management
- Exchange Server 2010 : Upgrading from and Coexisting with Exchange Server 2003 (part 6) - Upgrading Message Connectivity From Exchange Server 2003
- Exchange Server 2010 : Upgrading from and Coexisting with Exchange Server 2003 (part 5)
- Exchange Server 2010 : Upgrading from and Coexisting with Exchange Server 2003 (part 4)
- Exchange Server 2010 : Upgrading from and Coexisting with Exchange Server 2003 (part 3)
- Exchange Server 2010 : Upgrading from and Coexisting with Exchange Server 2003 (part 2)
- Exchange Server 2010 : Upgrading from and Coexisting with Exchange Server 2003 (part 1)
- Exchange Server 2010 : Useful Tools for an Upgrade (part 1)
- Exchange Server 2010 : Useful Tools for an Upgrade (part 1)
- Active Directory Domain Services 2008: Modify the Precedence for Password Settings Objects
- Active Directory Domain Services 2008: Apply a Password Settings Object to Users and Security Groups
- Active Directory Domain Services 2008: Modify Settings Defined in Password Settings Objects
- BizTalk Server 2009 : Getting results from asynchronous invocations (part 3)
- BizTalk Server 2009 : Getting results from asynchronous invocations (part 2)
 
 
 
Top 10
 
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Finding containers and lists in Visio (part 2) - Wireframes,Legends
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Finding containers and lists in Visio (part 1) - Swimlanes
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Formatting and sizing lists
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Adding shapes to lists
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Sizing containers
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 3) - The Other Properties of a Control
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 2) - The Data Properties of a Control
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 1) - The Format Properties of a Control
- Microsoft Access 2010 : Form Properties and Why Should You Use Them - Working with the Properties Window
- Microsoft Visio 2013 : Using the Organization Chart Wizard with new data
- First look: Apple Watch

- 3 Tips for Maintaining Your Cell Phone Battery (part 1)

- 3 Tips for Maintaining Your Cell Phone Battery (part 2)
programming4us programming4us